//
//  LGCarePlanMonitorCell.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/9/18.
//  照护计划 -- 全年体征监测

#import "LGCarePlanMonitorCell.h"

#define lineHeight   viewPix(35)

@interface LGCarePlanMonitorCell()
/**   */
@property (nonatomic , strong)UILabel *titleLabel;
/**   */
@property (nonatomic , strong)UILabel *contentLabel;

@end

@implementation LGCarePlanMonitorCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
    }
    return  self;
}

-(void)setDataDic:(NSDictionary *)dataDic{
    [super setDataDic:dataDic];
    self.titleLabel.text = LGNSString(dataDic[@"title"]);
    self.contentLabel.text = LGNSString(dataDic[@"num"]).length>0 ? LGNSString(dataDic[@"num"]):@" ";
}


#pragma mark
#pragma mark ====> 创建控件
-(void)createSubView{
    self.type = LGPositionTypeMiddle;
    [self.baseView addSubview:self.titleLabel];
    [self.baseView addSubview:self.contentLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.baseView).offset(viewPix(12));
        make.centerY.equalTo(self.contentLabel);
    }];
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.baseView).offset(-viewPix(12));
        make.top.equalTo(self.baseView).offset(viewPix(6));
        make.left.equalTo(self.baseView).offset(viewPix(100));
        make.bottom.equalTo(self.baseView).offset(-viewPix(6));
    }];
}

-(UILabel *)titleLabel{
    if(!_titleLabel){
        _titleLabel = [UILabel lableWithText:@"" colorString:@"#666666" textFont:LGFont(16) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _titleLabel;
}

-(UILabel *)contentLabel{
    if(!_contentLabel){
        _contentLabel = [UILabel lableWithText:@"" colorString:@"#282828" textFont:LGFont(16) textAlignment:NSTextAlignmentRight lines:0];
    }
    return _contentLabel;
}



@end
